import {
	ref,
	onMounted,
	nextTick
} from "vue"
export default function usePicker(id) {

	return new Promise((resolve, reject) => {
		try {
			nextTick(() => {
				const systemInfo = uni.getSystemInfoSync();
				let pickerDomInfo = null;
				const query = uni.createSelectorQuery();
				query.select(`#${id}`).boundingClientRect((res) => {
					// console.log(JSON.stringify(res))
					pickerDomInfo = res;
					resolve({
						systemInfo,
						pickerDomInfo
					})
				}).exec();
			})
		} catch (e) {
			//TODO handle the exception
			resolve({systemInfo,pickerDomInfo})
		}


	})


}